In Lesson 3 of AeroPython, you learned that it is possible to represent potential flow around a circular cylinder using the superposition of a doublet singularity and a free stream. But potential flow is even more powerful: you can represent the flow around any shape. How is it possible, you might ask?
For non-lifting bodies, you can use a source distribution on the body surface, superposed with a free stream. In this assignment, you will build the flow around a NACA0012 airfoil, using a set of sources.
Before you start, take a moment to think: in flow around a symmetric airfoil at $0^{\circ}$ angle of attack,
At the end of this assignment, come back to these questions, and see if it all makes sense.
You will read data files containing information about the location and the strength of a set of sources located on the surface of a NACA0012 airfoil.
There are three data files: NACA0012_x.txt, NACA0012_y.txt, and NACA0012_sigma.txt. To load each file into a NumPy array, you need the function numpy.loadtxt
. The files should be found in the resources
folder of the lessons
.
Using 51 mesh points in each direction, and a domain $[-1, 2]\times[-0.5, 0.5]$, compute the velocity due to the set of sources plus a free stream in the $x$-direction with $U_{\infty}=1$. Also compute the coefficient of pressure on your grid points.
Make the following plots to visualize and inspect the resulting flow pattern:
Hint: You might use the following NumPy functions: numpy.unravel_index
and numpy.argmax
In [1]:
from IPython.core.display import HTML
def css_styling():
styles = open('../styles/custom.css', 'r').read()
return HTML(styles)
css_styling()
Out[1]: